library(shiny)

# Tab for the scatter plot output
sct_plot <- tabPanel(
    "Scatter plot",
    # Div for the scatter plot
    tags$div(id = "sct_container",
             tags$div(id = "scatterplot_area"),
             tags$div(id = "sct_checkboxall_area"), # div for checkboxes
             tags$div(id = "sct_checkbox_area"), # div for checkboxes
             tags$div(id = "sct_dropdown_area")), # div for dropdown menu

    # Div for map
    tags$div(id = "map_area")
)

parset <- tabPanel(
    "Parallel Sets",
    tags$div(id = "treemap_area"),
    tags$div(id = "parset_area")
)

# Tab for dendrogram
dendrogram <- tabPanel(
    "Dendrogram",
    #Div for the tree
    tags$div(id = "dendrogram_area")
)

# Tab choropleth
choropleth <- tabPanel(
    "Choropleth",
# Div for the bar chart
    tags$div(id = "choropleth_heatmap_container",
             tags$div(id = "choropleth_dropdown_area"),
             tags$div(id = "choropleth_area"),
             tags$div(id = "super_container",
                      tags$div(id = "smallmultiples_container",
                               tags$div(id = "sm2012_area"),
                               tags$div(id = "sm2013_area"),
                               tags$div(id = "sm2014_area"),
                               tags$div(id = "sm2015_area"),
                               tags$div(id = "sm2016_area"),
                               tags$div(id = "sm2017_area")
                               ),
                      tags$div(id = "heatmap_container",
                               tags$div(id = "heatmap_2012_area"),
                               tags$div(id = "heatmap_2013_area"),
                               tags$div(id = "heatmap_2014_area"),
                               tags$div(id = "heatmap_2015_area"),
                               tags$div(id = "heatmap_2016_area"),
                               tags$div(id = "heatmap_2017_area")
                               )
                      )
             ),
    tags$div(id = "heatmap_stripes_area")
)

# main content UI layout
body <- mainPanel(

    tabsetPanel(
        sct_plot,
        dendrogram,
        choropleth,
        parset
    )
)

# Combine different UI elements to form app
ui <- fluidPage(

    tags$head(tags$link(rel = "stylesheet", type = "text/css", href = "style.css"),
              tags$script(src="d3.js"),
              tags$script(src="polybrush.js"),
              tags$script(src="d3-color.js"),
              tags$script(src="d3.parsets.js"),
              tags$script(src="parset.js"),
              tags$script(src="scatterplot.js"),
              tags$script(src="dendrogram.js"),
              #tags$script(src="treemap.js"),
              tags$script(src="heatmap-table.js"),
              tags$script(src="choropleth.js"),
              tags$script(src="radarchart.js")),
              #tags$script(src="http://d3js.org/d3.v5.min.js"),

    body
)
